<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    .da{
        width:300px;
        height:300px;
        border:5px solid red;
    }

    .a,.b{
        width:80px;
        height:80px;
    }

    .a{
        background-color:orange;
        float:left; /*靠左边浮动*/
        margin:10px;
    }

    .b{
        background:blue; /*简写*/
        float:right; /*靠右边浮动*/
        margin:10px;
    }
</style>
<body>
    
    <div class="da">
        <div class="a"></div>
        <div class="b"></div>
    </div>
</body>
</html>